home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 108 / MacAddict108.iso / Software / Internet & Communication / WordPress 1.5.1.dmg / wordpress / wp-admin / bookmarklet.php < prev    next >
Encoding:
PHP Script  |  2005-02-15  |  2.5 KB  |  109 lines

  1. <?php
  2. $mode = 'bookmarklet';
  3. require_once('admin.php');
  4.  
  5. if ($user_level == 0)
  6.     die ("Cheatin' uh?");
  7.  
  8. if ('b' == $a) {
  9.  
  10. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  11. <html xmlns="http://www.w3.org/1999/xhtml">
  12. <head>
  13. <script type="text/javascript">
  14. <!--
  15. window.close()
  16. -->
  17. </script>
  18. </head>
  19. <body></body>
  20. </html>
  21. <?php
  22. } else {
  23.     $popuptitle = wp_specialchars(stripslashes($popuptitle));
  24.     $text       = wp_specialchars(stripslashes(urldecode($text)));
  25.     
  26.     $popuptitle = funky_javascript_fix($popuptitle);
  27.     $text       = funky_javascript_fix($text);
  28.     
  29.     $post_title = wp_specialchars($_REQUEST['post_title']);
  30.     if (!empty($post_title)) {
  31.         $post_title =  stripslashes($post_title);
  32.     } else {
  33.         $post_title = $popuptitle;
  34.     }
  35.     
  36.     $edited_post_title = wp_specialchars($post_title);
  37.  
  38. // $post_pingback needs to be set in any file that includes edit-form.php
  39.     $post_pingback = get_settings('default_pingback_flag');
  40.     
  41.     $content  = wp_specialchars($_REQUEST['content']);
  42.     $popupurl = wp_specialchars($_REQUEST['popupurl']);
  43.     if ( !empty($content) ) {
  44.         $content = wp_specialchars( stripslashes($_REQUEST['content']) );
  45.     } else {
  46.         $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
  47.     }
  48.     
  49.     /* /big funky fixes */
  50.  
  51. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  52. <html xmlns="http://www.w3.org/1999/xhtml">
  53. <head>
  54. <title><?php bloginfo('name') ?> › Bookmarklet — WordPress</title>
  55. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
  56. <link rel="stylesheet" href="wp-admin.css" type="text/css" />
  57.  
  58. <style type="text/css">
  59. <!--
  60.  
  61. #wpbookmarklet textarea,input,select {
  62.     border-width: 1px;
  63.     border-color: #cccccc;
  64.     border-style: solid;
  65.     padding: 2px;
  66.     margin: 1px;
  67. }
  68.  
  69. #wpbookmarklet .checkbox {
  70.     background-color: #ffffff;
  71.     border-width: 0px;
  72.     padding: 0px;
  73.     margin: 0px;
  74. }
  75.  
  76. #wpbookmarklet textarea {
  77.     font-family: Verdana, Geneva, Arial, Helvetica;
  78.     font-size: 0.9em;
  79. }
  80.  
  81. #wpbookmarklet .wrap {
  82.     border: 0px;
  83. }
  84.  
  85. #wpbookmarklet #postdiv {
  86.     margin-bottom: 0.5em;
  87. }
  88.  
  89. #wpbookmarklet #titlediv {
  90.     margin-bottom: 1em;
  91. }
  92.  
  93. -->
  94. </style>
  95. </head>
  96. <body id="wpbookmarklet">
  97. <div id="wphead">
  98. <h1><?php bloginfo('name') ?></h1>
  99. </div>
  100.  
  101. <?php require('edit-form.php'); ?>
  102.  
  103. <?php do_action('admin_footer', ''); ?>
  104.  
  105. </body>
  106. </html><?php
  107. }
  108. ?>
  109.